package gxmzu.gxmzuproject.service.impl;

import gxmzu.gxmzuproject.entity.MiniCarItem;
import gxmzu.gxmzuproject.mapper.MiniCarItemMapper;
import gxmzu.gxmzuproject.service.MiniCarItemService;
import gxmzu.gxmzuproject.param.MiniCarItemQueryParam;
import gxmzu.gxmzuproject.vo.MiniCarItemQueryVo;
import gxmzu.gxmzuproject.config.common.BaseServiceImpl;
import gxmzu.gxmzuproject.config.common.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.io.Serializable;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Code534
 * @since 2022-08-10
 */
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class MiniCarItemServiceImpl extends BaseServiceImpl<MiniCarItemMapper, MiniCarItem> implements MiniCarItemService {

    @Resource
    private MiniCarItemMapper miniCarItemMapper;

    @Override
    public MiniCarItemQueryVo getMiniCarItemById(Serializable id) {
        return miniCarItemMapper.getMiniCarItemById(id);
    }

    @Override
    public Paging<MiniCarItemQueryVo> getMiniCarItemPageList(MiniCarItemQueryParam param) {
        IPage<MiniCarItemQueryVo> iPage = miniCarItemMapper.getMiniCarItemPageList(getPage(param),param);
        return new Paging<>(iPage);
    }

}
